<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags"  prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>股价分析 -" ${attr.stockDTO.stockName}"日线数据</title>
      <link rel="stylesheet" type="text/css"	href="./styles/finance.css">
  </head>
  
  <body>
   		<div id="navigation">
   			当前位置: &nbsp; &nbsp;<a href="#">首页</a> &nbsp; &gt;&gt;  &nbsp; <a href="price/prepareStockPrice">股价分析</a>
   					  &nbsp; &gt;&gt;  &nbsp; <a href="finance/mainProfitDetail?stockDTO.stockCode=${attr.stockDTO.stockCode}">
   						${attr.stockDTO.stockName}(${attr.stockDTO.stockCode})日线数据</a>
   		</div>
		<div id="mainContent">
			<table align="center" border="1 solid">
				<thead >
					<tr>
						<td colspan="11" align="center">
							<span style="font-size:20px;"><B><s:property value="stockDTO.stockName"/></B></span>
							<span style="font-size:16px;">(${attr.stockDTO.stockCode})  - &nbsp;最新日线数据</span>
						</td>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td width="100px">日期	</td>
						<td width="120px">开盘价 	</td>
						<td width="100px">最高价	</td>
						<td width="130px">最低价	</td>
						<td width="130px">收盘价	</td>
						<td width="160px">成交量	</td>
						<td width="160px">成交额</td>
					</tr>
					<s:iterator value="#attr.stoStockdailyDTOList" var="stoStockdailyDTO">
						<tr>
							<td><s:date name="#attr.operateDate" format="yyyy-MM-dd" id="date" />
								<s:property value="date"/>
							</td>
							<td><s:property value="startPrice"/></td>
							<td><s:property value="maxPrice"/></td>
							<td><s:property value="minPrice"/></td>
							<td><s:property value="endPrice"/></td>
							<td><s:property value="amount"/></td>
							<td><s:property value="volume"/></td>
						</tr>
					</s:iterator>
				</tbody>
			</table>
			<div  class="pageNav">
						<!--define the url of the previous page and next page-->
					     <s:url id="url_index" value="/price/stockPriceDetail">
					         <s:param name="assistDto.currentPages" value="1"></s:param>
					     </s:url>
					     <s:url id="url_pre" value="/price/stockPriceDetail">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.currentPages-1"></s:param>
					     </s:url>
					     <s:url id="url_next" value="/price/stockPriceDetail">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.currentPages+1"></s:param>
					     </s:url> 
					     <s:url id="url_end" value="/price/stockPriceDetail">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.totalPages"></s:param>
					     </s:url> 
						<table align="center">
							<tr>
								<td>
									<s:if test="#attr.assistDto.currentPages <= 1">首页&nbsp;&nbsp;</s:if>
								 	<s:else><s:a href="%{url_index}">首页&nbsp;&nbsp;</s:a></s:else>
								</td>
								<td>
									<s:if test="#attr.assistDto.currentPages > 1">
										<s:a href="%{url_pre}">上一页&nbsp;&nbsp;</s:a>
									</s:if>
									<s:else>上一页&nbsp;&nbsp;</s:else>
								</td>
								<td>第${attr.assistDto.currentPages} 页&nbsp;&nbsp;</td>
								<td>
									<s:if test="#attr.assistDto.currentPages < #attr.assistDto.totalPages">
										<s:a href="%{url_next}">下一页&nbsp;&nbsp;</s:a>
									</s:if>
									<s:else>下一页&nbsp;&nbsp;</s:else>
								</td>
								<td>
									<s:if test="#attr.assistDto.currentPages == #attr.assistDto.totalPages || #attr.assistDto.totalPages<=1">尾页&nbsp;&nbsp;</s:if>
									<s:else>
										<s:a href="%{url_end}">尾页&nbsp;&nbsp;</s:a> 
									</s:else>
								</td>
								<td>
									   共${attr.assistDto.totalPages}页 &nbsp;&nbsp;
								</td> 
							</tr>
						</table>
					</div>	
		</div>
  </body>
</html>
